<?php
	require("includes/basic.php");
	if(!isset($_SESSION['uid']) && $userType!='O')
	{
		header("location:authorise.php");
	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
	<HEAD>
		
		<TITLE> :: <?php echo $appName?> :: </TITLE>
		<link rel='stylesheet' type='text/css' href='style/inner.css'>
		<script type='text/javascript' src='js/inner.js'></script>
		<script type='text/javascript' src='js/jquery-latest.js'></script>
		<script type='text/javascript'>
		$(document).ready(function()
		{
			$('#client-uname').focusout(function()
			{
				var uname =  $('#client-uname').val();
				
				if(uname== "")
				{
				  
				}
				
				else
				{
				var dataString = 'uname=' + uname;
				$.ajax
				({
					type: "POST",
					url: "checkuname.php",
					data: dataString,
					cache: false,
					success: function(html)
					{
						$("#error").html(html);
					} 
				});
				
				}
				
			});
			
		});
		</script>
		<script>
			function checkSubmit()
			{
				var error = document.getElementById('error').innerHTML;
				if(error == "Already exists")
				{
					return false;
				}
			}
		</script>
		<!-- validation start -->

		<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />
		<link rel="stylesheet" href="css/template.css" type="text/css" media="screen" title="no title" charset="utf-8" />
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
		<script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>
		<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
		
				
		<script>	
		$(document).ready(function() {

			
			$("#addclient").validationEngine()
		
		});
		
		
		function validate2fields(){
			if($("#firstname").val() =="" ||  $("#lastname").val() == ""){
				return false;
			}else{
				return true;
			}
		}
		</script>
		
		<!-- validation end -->

	</HEAD>

	<body unselectable="on" class="dialog"> 
		<?php $pageName="Administration View"; ?>
		<?php require("includes/header.php"); ?>

		<!-- devi : body content begins here -->
		<table class="dialog" cellpadding="0" cellspacing="0"><tr><td> 
		<table class="dialogbox" cellpadding="0" cellspacing="0"> 
		<tr><td> 
		<div class="dialoghead" unselectable="on">



		Client Setup Wizard
		</div><div class="dialogcontent" style="height: 450px;" unselectable="on">

		<form method="post" onSubmit="return checkSubmit()" action="add-client-process.php" id="addclient" class="nomargin" enctype="multipart/form-data">

		<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">
		<tr><td style="vertical-align: top;">

		<div class="dialogspacer" unselectable="on">&nbsp;</div>
			<?php $buttonTitle = "Add a Client"; ?>
			<?php $buttonSize = "200px"; ?>
			<?php require("greenHeaderButton.php"); ?>
		<div class="dialogspacer" unselectable="on">&nbsp;</div>

		<div class="dialogblockborder dialogblockborderheadline" unselectable="on"> 
		<div class="dialogblock" unselectable="on"> 
		<span class="dialogblockhead" unselectable="on">Security</span>

		<table border="0" cellpadding="2" cellspacing="0">
			<tr>
				<td>Username : </td>
				<td><input type="text" name="client-uname" id="client-uname" class="validate[required,custom[email]] text-input" size="8" style="width:150px;" value=''></td>
				<td><img id="img1" name="img1" src="images/help.png" border="0" onmouseout="hideHelp(1);" onmouseover="showHelp(1);"></td>
				<td id='error'></td>
			</tr>
			<tr>
				<td>Password : </td>
				<td><input type="password" name="client-pass" id="client-pass" class="validate[required] text-input" size="8" style="width:150px;" value=''></td>
				<td><img id="img2" name="img2" src="images/help.png" border="0" onmouseout="hideHelp(2);" onmouseover="showHelp(2);"></td>
				<td></td>
			</tr>
			<tr>
				<td>Retype the Password : </td>
				<td><input type="password" name="client-pass1" id="client-pass1" class="validate[required,equals[client-pass]] text-input" size="8" style="width:150px;" value=''></td>
				<td><img id="img3" name="img3" src="images/help.png" border="0" onmouseout="hideHelp(3);" onmouseover="showHelp(3);"></td>
				<td></td>
			</tr>
		</table>
		</div></div>


		</td></tr>
		<tr><td style="vertical-align: middle;">
			<div class="dialogspacer" unselectable="on">&nbsp;</div>
			<div class="dialogspacer" unselectable="on">&nbsp;</div>
		</td></tr>
		<tr><td style="vertical-align: bottom;">


		<div class="dialogblockborder dialogblockborderheadline" unselectable="on"> 
		<div class="dialogblock" unselectable="on"> 
		<span class="dialogblockhead" unselectable="on">Client Details</span>


		<table border="0" cellpadding="2" cellspacing="0">
			<tr>
				<td>Client Name : </td>
				<td><input type="text" name="client-name" id="client-name" class="validate[required] text-input" size="8" style="width:150px;" value=''></td>
				<td><img id="img4" name="img4" src="images/help.png" border="0" onmouseout="hideHelp(4);" onmouseover="showHelp(4);">
			</tr>
			<tr>
				<td>Client Description : </td>
				<td><TEXTAREA NAME="client-desc" id="client_desc" class="validate[required] text-input" ROWS="6" COLS="60"></TEXTAREA></td>
				<td><img id="img5" name="img5" src="images/help.png" border="0" onmouseout="hideHelp(5);" onmouseover="showHelp(5);">
			</tr>
			<!--<tr>
				<td>Username : </td>
				<td><input type="text" name="client-uname" size="8" style="width:150px;" value=''></td>
				<td><img id="img3" name="img3" src="images/help.png" border="0" onmouseout="hideHelp(3);" onmouseover="showHelp(3);">
			</tr>
            
            <tr>
				<td>Password : </td>
				<td><input type="password" name="client-pass" size="8" style="width:150px;" value=''></td>
				<td><img id="img4" name="img4" src="images/help.png" border="0" onmouseout="hideHelp(4);" onmouseover="showHelp(4);">
			</tr>-->
            
            <tr>
				<td>Client Type : </td>
				<td><select name="client-type" id="client-type"><option value="A">Active</option><option value="P">Prospective</option></select></td>
				<td><img id="img6" name="img6" src="images/help.png" border="0" onmouseout="hideHelp(6);" onmouseover="showHelp(6);">
			</tr>

			<tr>
				<td>Upload Logo : </td>
				<td><INPUT TYPE="file" NAME="uploadedfile"></td>
				<td><img id="img7" name="img7" src="images/help.png" border="0" onmouseout="hideHelp(7);" onmouseover="showHelp(7);">
			</tr>
            
            <!-- <tr>
				<td>Record Status : </td>
				<td><select name="status"><option value="Y">Yes</option><option value="N">No</option></select></td>
				<td><img id="img6" name="img6" src="images/help.png" border="0" onmouseout="hideHelp(6);" onmouseover="showHelp(6);">
			</tr>-->
		</table>
		</div></div>

		</td></tr>
		</table>
		</div>
		 

		<div class="dialogbuttons" unselectable="on">

		<input name="back" type="button" value="&#060;&#060; Back" class="dialogbutton" onclick="javascript:history.go(-1)">
		<input name="submit" type="submit" value="Save &#062;&#062;" class="dialogbutton">
		<input name="cancel" type="button" value="Cancel" class="dialogbutton" onclick="window.location.href='index.php';" style="margin-left: 50px;">
		</form>
		</div>


		<div class="help" name="help1" id="help1" onmouseout="hideHelp(1);" onmouseover="showHelp(1);">
			The username required for the client to login
		</div>


		<div class="help" name="help2" id="help2" onmouseout="hideHelp(2);" onmouseover="showHelp(2);">
			The password required for the customer to login
		</div>

		<div class="help" name="help3" id="help3" onmouseout="hideHelp(3);" onmouseover="showHelp(3);">
			Please retype the same password again. This process helps us ensure you do not make any typographical errors when you enter a password.
		</div>

		<div class="help" name="help4" id="help4" onmouseout="hideHelp(4);" onmouseover="showHelp(4);">
			Enter the name of the client
		</div>

		<div class="help" name="help5" id="help5" onmouseout="hideHelp(5);" onmouseover="showHelp(5);">
			Enter the Client description
		</div>

		<div class="help" name="help6" id="help6" onmouseout="hideHelp(6);" onmouseover="showHelp(6);">
			Select the Client type
		</div>

		<div class="help" name="help7" id="help7" onmouseout="hideHelp(7);" onmouseover="showHelp(7);">
			Upload Client Logo (Upload only PNG,JPEG,TIFF,GIF)
		</div>

		<!--<div class="help" name="help7" id="help7" onmouseout="hideHelp(7);" onmouseover="showHelp(7);">
			Enter the postal address of the company
		</div>-->

		</td></tr></table> 
		</td></tr></table> 
		<p>&nbsp;</p> 

		<!-- devi : body content ends here -->
		
		<?php require("includes/footer.php"); ?>
	</BODY>
</HTML>
